From 3e16170919ce88b7e920f72dfc776d69461ab6b2 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 3 Mar 2006 10:34:03 +0100 Subject: [PATCH] Add a 'clear trap table' path to set_trap_table hypercall, taken when the input table is NULL. Also, no need for set_trap_table to take the per-domain biglock. Signed-off-by: Keir Fraser --- xen/arch/x86/traps.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 97cf8bb5ab..78bff071d8 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1410,7 +1410,13 @@ long do_set_trap_table(struct trap_info *traps) struct trap_info *dst = current->arch.guest_context.trap_ctxt; long rc = 0; - LOCK_BIGLOCK(current->domain); + /* If no table is presented then clear the entire virtual IDT. */ + if ( traps == NULL ) + { + memset(dst, 0, 256 * sizeof(*dst)); + init_int80_direct_trap(current); + return 0; + } for ( ; ; ) { @@ -1440,8 +1446,6 @@ long do_set_trap_table(struct trap_info *traps) traps++; } - UNLOCK_BIGLOCK(current->domain); - return rc; } -- 2.30.2